import request from "@/utils/request"

// 获取所有菜单信息
export const getAllMenus = () => {
  return request({
    method: 'GET',
    url: '/boss/menu/getAll'
  })
}

// 提交表单数据(新增或编辑菜单接口函数)
export const createMenusItem = (data) => {
  return request({
    method: 'POST',
    url: '/boss/menu/saveOrUpdate',
    data
  })
}

// 根据 id 删除某个菜单
export const deleteMenu = (id = 0) => {
  return request({
    method: 'DELETE',
    url: `/boss/menu/${id}`
  })
}

// 获取编辑菜单页面信息
export const getEditMenuInfo = (id) => {
  return request({
    method: 'GET',
    url: '/boss/menu/getEditMenuInfo',
    params: {
      id
    }
  })
}